import request from '@/utils/request'

// 添加规章制度
export function addRegulation(res) {
  return request({
    url: '/regulatory/regulation/create',
    method: 'post',
    data: res
  })
}
//查询规章制度列表
export function getPage(data) {
  return request({
    url: '/regulatory/regulation/getList',
    method: 'GET',
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize,
      title: data.title,
      type: data.type
    }
  })
}
export function getInfo(id) {
  return request({
    url: '/regulatory/regulation/getInfo/'+ id,
    method: 'GET',
  })
}
//修改
export function updateRegulation(res) {
  return request({
    url: '/regulatory/regulation/update',
    method: 'post',
    data: res
  })
}
//删除
export function deleteRegulation(res) {
  return request({
    url: '/regulatory/regulation/delete/'+res,
    method: 'post'
  })
}
export function detailRegulation() {
  return request({
    url: '/sys/dict/detail/list?pageNum=1&pageSize=100&dictType=rule_type',
    method: 'get'
  })
}
//批量删除
export function deleteList(res) {
  return request({
    url: '/regulatory/regulation/deleteList',
    method: 'post',
    data: res,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

